<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Debian Chroot</title>
        <link href="/webman/help/help.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <h1>Debian Chroot</h1>
        <p><a href="http://www.debian.org/">Debian</a> is a free operating system (OS)
            that comes with over 29000 packages, precompiled software bundled up in a
            nice format for easy installation on your DiskStation. Debian Chroot allows
            you to benefit from the Debian OS inside your DiskStation, alongside DSM.
            This package is intended for advanced users only.</p>
        <h3>Installation</h3>
        <p>Once the installation finished in the Package Center, it continues in the
            background and you can see its status to <b>Installing</b> under
            <b>Overview</b> in the left pane. The installation finished, the status
            will automatically change to <b>Installed</b>.</p>
        <p>In the same pane, you can monitor how many services are running and perform
            update operations.</p>
        <h3>Usage</h3>
        <p>As soon as the status is <b>Installed</b>, you can start using the chroot.
            To do so, connect to the DiskStation through SSH (root user) and use the following command:
            <b>/var/packages/debian-chroot/scripts/start-stop-status chroot</b>.</p>
        <p>On the first use, it is recommended to perform some configuration operations:</p>
        <ul>
            <li>Update: type <b>apt-get update</b> followed by <b>apt-get upgrade</b></li>
            <li>Locales: type <b>apt-get install locales</b> and then <b>dpkg-reconfigure locales</b></li>
            <li>Timezone: execute <b>dpkg-reconfigure tzdata</b></li>
        </ul>
        <h3>Configure Services</h3>
        <p>Debian Chroot allows you to manage the packages you installed in the chroot directly
        from DSM.</p>
        <p>Under <b>Services</b> in the left pane, you can manage services that
            you manually installed previously in the chroot: start and stop them
            easily.</p>
        <h4>Configuration</h4>
        <ol>
            <li>Manually install in the chroot the service you chose</li>
            <li>Configure it by editing the correct configuration files</li>
            <li>In the interface, click on <b>Add</b> and fill the form.
                The <b>launch script</b> will be launched with the <b>start</b>
                argument to start the service and <b>stop</b> to stop it. The
                <b>status command</b> shall return 0 exit code if the service
                is started or 1 if it is stopped.</li>
        </ol>
        <h4>Example: SSH Server</h4>
        <ol>
            <li>Install the SSH server: <b>apt-get install ssh</b></li>
            <li>Edit the configuration file: <b>/etc/ssh/sshd_config</b> in order
            to change the port number and other things if necessary</li>
            <li>Click on <b>Add</b> and put the name <b>SSHD</b>, the launch
                script <b>/etc/init.d/ssh</b> and the status command
                <b>ps -p $(cat /var/run/sshd.pid)</b></li>
        </ol>
    </body>
</html>
